package com.hmbe.controller;

import com.hmbe.dto.HmBeUserDto;
import com.hmbe.dto.Result;
import com.hmbe.service.HmBeUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class HmBeLoginController {
    @Autowired
    private HmBeUserService hmBeUserService;

    @PostMapping("/reg")
    public  Result register(@RequestBody HmBeUserDto dto) {
        System.out.println("dto = " + dto);
        return hmBeUserService.reg(dto);
    }
    @PostMapping("/login")
    public  Result login(@RequestBody HmBeUserDto dto) {
        System.out.println("dto = " + dto);
        return hmBeUserService.login(dto);
    }

}
